<?php

namespace Mobile\Controller;

class TagController extends CommonController
{
    /**
     * 文章列表
     */
    public function lists()
    {
        $this->assign('pagemark', 'tag');
        $this->display();
    }

    /**
     * 文章详细页
     */
    public function view()
    {
        $this->assign('pagemark', 'tag');
        $this->display();
    }

    /**
     * ajax文章列表
     */
    public function ajax_tag_list()
    {
        $p = I('get.p', '1', 'intval');
        $startrow = ($p - 1) * 6;
        $this->assign(compact('startrow'));
        $html = $this->fetch('ajax_tag_list');
        if (substr($html, -13) == '<!--empty -->') {
            $this->ajaxReturn(0, '没有数据');
        }
        $this->ajaxReturn(1, '', array(
            'html' => $html,
            'loadurl' => query_url('ajax_tag_list', array('p' => $p + 1), '', true),
        ));
    }
}